home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Dictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  4.5 KB  |  164 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Dictionary.h
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DICTIONARY__
  19. #define __DICTIONARY__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51.  
  52. enum {
  53.                                                                 /* Dictionary data insertion modes */
  54.     kInsert                        = 0,                            /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
  55.     kReplace                    = 1,                            /* Only replace the entries which match the key with the input entry. */
  56.     kInsertOrReplace            = 2                                /* Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. */
  57. };
  58.  
  59. /* This Was InsertMode */
  60. typedef short                             DictionaryDataInsertMode;
  61.  
  62. enum {
  63.                                                                 /* Key attribute constants */
  64.     kIsCaseSensitive            = 0x10,                            /* case sensitive = 16        */
  65.     kIsNotDiacriticalSensitive    = 0x20                            /* diac not sensitive = 32    */
  66. };
  67.  
  68.  
  69. enum {
  70.                                                                 /* Registered attribute type constants.    */
  71.     kNoun                        = -1,
  72.     kVerb                        = -2,
  73.     kAdjective                    = -3,
  74.     kAdverb                        = -4
  75. };
  76.  
  77. /* This Was AttributeType */
  78. typedef SInt8                             DictionaryEntryAttribute;
  79. /* Dictionary information record */
  80.  
  81. struct DictionaryInformation {
  82.     FSSpec                             dictionaryFSSpec;
  83.     SInt32                             numberOfRecords;
  84.     SInt32                             currentGarbageSize;
  85.     ScriptCode                         script;
  86.     SInt16                             maximumKeyLength;
  87.     SInt8                             keyAttributes;
  88. };
  89. typedef struct DictionaryInformation    DictionaryInformation;
  90.  
  91. struct DictionaryAttributeTable {
  92.     UInt8                             datSize;
  93.     DictionaryEntryAttribute         datTable[1];
  94. };
  95. typedef struct DictionaryAttributeTable    DictionaryAttributeTable;
  96. typedef DictionaryAttributeTable *        DictionaryAttributeTablePtr;
  97. EXTERN_API( OSErr )
  98. InitializeDictionary            (const FSSpec *            theFsspecPtr,
  99.                                  SInt16                 maximumKeyLength,
  100.                                  SInt8                     keyAttributes,
  101.                                  ScriptCode             script)                                THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
  102.  
  103. EXTERN_API( OSErr )
  104. OpenDictionary                    (const FSSpec *            theFsspecPtr,
  105.                                  SInt8                     accessPermission,
  106.                                  SInt32 *                dictionaryReference)                THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
  107.  
  108. EXTERN_API( OSErr )
  109. CloseDictionary                    (SInt32                 dictionaryReference)                THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
  110.  
  111. EXTERN_API( OSErr )
  112. InsertRecordToDictionary        (SInt32                 dictionaryReference,
  113.                                  ConstStr255Param         key,
  114.                                  Handle                 recordDataHandle,
  115.                                  DictionaryDataInsertMode  whichMode)                        THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
  116.  
  117. EXTERN_API( OSErr )
  118. DeleteRecordFromDictionary        (SInt32                 dictionaryReference,
  119.                                  ConstStr255Param         key)                                THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
  120.  
  121. EXTERN_API( OSErr )
  122. FindRecordInDictionary            (SInt32                 dictionaryReference,
  123.                                  ConstStr255Param         key,
  124.                                  DictionaryAttributeTablePtr  requestedAttributeTablePointer,
  125.                                  Handle                 recordDataHandle)                    THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
  126.  
  127. EXTERN_API( OSErr )
  128. FindRecordByIndexInDictionary    (SInt32                 dictionaryReference,
  129.                                  SInt32                 recordIndex,
  130.                                  DictionaryAttributeTablePtr  requestedAttributeTablePointer,
  131.                                  Str255                 recordKey,
  132.                                  Handle                 recordDataHandle)                    THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
  133.  
  134. EXTERN_API( OSErr )
  135. GetDictionaryInformation        (SInt32                 dictionaryReference,
  136.                                  DictionaryInformation * theDictionaryInformation)            THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
  137.  
  138. EXTERN_API( OSErr )
  139. CompactDictionary                (SInt32                 dictionaryReference)                THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
  140.  
  141.  
  142.  
  143.  
  144. #if PRAGMA_STRUCT_ALIGN
  145.     #pragma options align=reset
  146. #elif PRAGMA_STRUCT_PACKPUSH
  147.     #pragma pack(pop)
  148. #elif PRAGMA_STRUCT_PACK
  149.     #pragma pack()
  150. #endif
  151.  
  152. #ifdef PRAGMA_IMPORT_OFF
  153. #pragma import off
  154. #elif PRAGMA_IMPORT
  155. #pragma import reset
  156. #endif
  157.  
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161.  
  162. #endif /* __DICTIONARY__ */
  163.  
  164.